package com.ruoyi.dash.service.impl;

import java.util.List;
import java.util.UUID;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dash.mapper.TbMemberEnterpriseMapper;
import com.ruoyi.dash.domain.TbMemberEnterprise;
import com.ruoyi.dash.service.ITbMemberEnterpriseService;

/**
 * 成员企业信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-22
 */
@Service
public class TbMemberEnterpriseServiceImpl implements ITbMemberEnterpriseService 
{
    @Autowired
    private TbMemberEnterpriseMapper tbMemberEnterpriseMapper;

    /**
     * 查询成员企业信息
     * 
     * @param enterpriseId 成员企业信息主键
     * @return 成员企业信息
     */
    @Override
    public TbMemberEnterprise selectTbMemberEnterpriseByEnterpriseId(String enterpriseId)
    {
        return tbMemberEnterpriseMapper.selectTbMemberEnterpriseByEnterpriseId(enterpriseId);
    }

    /**
     * 查询成员企业信息列表
     * 
     * @param tbMemberEnterprise 成员企业信息
     * @return 成员企业信息
     */
    @Override
    public List<TbMemberEnterprise> selectTbMemberEnterpriseList(TbMemberEnterprise tbMemberEnterprise)
    {
        return tbMemberEnterpriseMapper.selectTbMemberEnterpriseList(tbMemberEnterprise);
    }

    /**
     * 新增成员企业信息
     * 
     * @param tbMemberEnterprise 成员企业信息
     * @return 结果
     */
    @Override
    public int insertTbMemberEnterprise(TbMemberEnterprise tbMemberEnterprise)
    {
        tbMemberEnterprise.setEnterpriseId(UUID.randomUUID().toString());
        tbMemberEnterprise.setCreateTime(DateUtils.getNowDate());
        return tbMemberEnterpriseMapper.insertTbMemberEnterprise(tbMemberEnterprise);
    }

    /**
     * 修改成员企业信息
     * 
     * @param tbMemberEnterprise 成员企业信息
     * @return 结果
     */
    @Override
    public int updateTbMemberEnterprise(TbMemberEnterprise tbMemberEnterprise)
    {
        tbMemberEnterprise.setUpdateTime(DateUtils.getNowDate());
        return tbMemberEnterpriseMapper.updateTbMemberEnterprise(tbMemberEnterprise);
    }

    /**
     * 批量删除成员企业信息
     * 
     * @param enterpriseIds 需要删除的成员企业信息主键
     * @return 结果
     */
    @Override
    public int deleteTbMemberEnterpriseByEnterpriseIds(String[] enterpriseIds)
    {
        return tbMemberEnterpriseMapper.deleteTbMemberEnterpriseByEnterpriseIds(enterpriseIds);
    }

    /**
     * 删除成员企业信息信息
     * 
     * @param enterpriseId 成员企业信息主键
     * @return 结果
     */
    @Override
    public int deleteTbMemberEnterpriseByEnterpriseId(String enterpriseId)
    {
        return tbMemberEnterpriseMapper.deleteTbMemberEnterpriseByEnterpriseId(enterpriseId);
    }
}
